package com.itheima.Demo;

import java.util.HashMap;
import java.util.Map;
import java.util.Set;

public class Demo03Map的遍历 {
    public static void main(String[] args) {
        Map<String,String> map  =  new HashMap<>();
        //添加键对值;
        map.put("大鹏","柳岩");
        map.put("罗志祥","周扬青");
        map.put("小岳岳","孙越");
        //keySet()键找值方式
        //返回值代表是键的Set集合
        Set<String> s = map.keySet();

        //使用增强for遍历set集合
        for (String key : s) {
            //根据键获取值;
            String value = map.get(key);
            System.out.println(value);
        }




    }
}
